package com.gwt.server;

import java.util.ArrayList;
import java.util.List;


import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.ObjectifyService;
import com.gwt.client.ItemDatabaseService;
import com.gwt.client.ItemInfo;


public class ItemDatabaseServiceImpl extends RemoteServiceServlet implements ItemDatabaseService{
	private static final long serialVersionUID = 1L;

//	private final String itemsPackage="com.game.code.items";
	
	private final String classesList[]={"Brick1",
										"Brick2",
										"Brick3"
		    };

	
	public List <ItemInfo> getClassesList(){
		
		List <ItemInfo> itemsInfo = new ArrayList<ItemInfo> ();

		for (String className : classesList) {
				itemsInfo.add(new ItemInfo(className));
		}
		
		ItemsInfoContainer itemsInfoContainer = new ItemsInfoContainer("1","");
		
		ObjectifyService.register(ItemsInfoContainer.class);
		Objectify ofy = ObjectifyService.begin();
		
		ofy.put(itemsInfoContainer);

		return itemsInfo;
	}

	
	public void getLevel(String id){
		
	}
	
	
	
}
